<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 当页面宽度大于1200px*/
        
        @media screen and (min-width:1200px) {
            body {
                background: saddlebrown;
            }
        }
        /* 当页面宽度大于960px小于1200px */
        
        @media screen and (min-width:960px) and (max-width:1200px) {
            body {
                background: yellow;
            }
        }
        /* 当页面宽度大于600px小于960px */
        
        @media screen and (min-width:600px) and (max-width:960px) {
            body {
                background: darkmagenta;
            }
        }
        /* 当页面宽度大于300px小于600px */
        
        @media screen and (min-width:300px) and (max-width:600px) {
            body {
                background: aqua;
            }
        }
        /* 当页面宽度小于300px*/
        
        @media screen and (max-width:300px) {
            body {
                background: salmon;
            }
        }
    </style>
</head>

<body>

    <div class="box">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </div>
</body>

</html>